#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAXN = 1e5 + 10;
LL n;
LL cnt = 0;
LL r[MAXN];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1 ; i <= n ; ++i) cin >> r[i];
    sort(r+1,r+n+1);
    LL pos = 2;
    while (r[pos] <= r[1]) pos++;
    //cout << pos << "\n";
    LL k = 1;
    while (pos != (n + 1))
    {
        if (r[pos] > r[k])
        {
            cnt++;
            pos++;
            k++;
        }
        else pos++;

    }
    LL ans = n-cnt;
    cout << ans << "\n";
    //for (int i = 1 ; i <= n ; ++i) cout << r[i] <<" ";
    return 0;
}

